﻿using log4net;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
[assembly: log4net.Config.XmlConfigurator(ConfigFile = "log4net.config", Watch = true)]//加载配置文件（重点是在logconfig 的文件位置，必须复制一份在应用程序的根目录，与webconfig同级，暂时没有好办法。还有一个动态加载可以尝试（ //var logCfg = new FileInfo(AppDomain.CurrentDomain.BaseDirectory + "log4net.config");
                                                                                       //log4net.Config.XmlConfigurator.ConfigureAndWatch(logCfg);））
namespace ZK.Common.Log4
{
    internal class Log4NetFile
    {
        private static readonly ILog LogInfo = LogManager.GetLogger("Info");
        private static readonly ILog LogErr = LogManager.GetLogger("Err");
        private static readonly ILog LogWarn = LogManager.GetLogger("Warn");
        private static readonly ILog LogDebug = LogManager.GetLogger("Debug");
        public static void Err(string message)
        {
            LogErr.Error(message);
        }
        public static void Info(string message)
        {
            LogInfo.Info(message);
        }
        public static void Warn(string message)
        {
            LogWarn.Warn(message);
        }
        public static void Debug(string message)
        {
            LogDebug.Debug(message);
        }
    }
}
